package com.yousu.wxqropendoor.controller;


import com.alibaba.fastjson.JSON;
import com.yousu.wxqropendoor.entity.ManageCommunity;
import com.yousu.wxqropendoor.service.IManageCommunityService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author cwb
 * @since 2020-02-28
 */
@Slf4j
@RestController
@RequestMapping("/manage-community")
public class ManageCommunityController {
    @Autowired
    IManageCommunityService iManageCommunityService;

    /**
     * 微信小程序功能：按拼音首字母返回小区信息
     *
     * @return jsonString
     */
    @PostMapping("listForWx")
    public Object listForWx(
            @RequestParam(value = "status") Integer status
    ) {
        return JSON.toJSON(iManageCommunityService.listOnWx(status));
    }

}

